import fetch from './fetch'

export function sendLoginSMS({ mobile, captcha }) {
	return fetch({
		url: 'insurance/business/login/sendSMSCode',
		method: 'get',
		params: { mobile, captcha }
	})
}

export function doLogin({ username, password }) {
	return fetch({
		url: 'insurance/doLogin',
		method: 'get',
		params: { password, username }
	})
}

export function doSMSLogin({ mobile, code }) {
	return fetch({
		url: 'insurance/business/login/checkSMSCode',
		method: 'post',
		data: { mobile, code },
		headers: {
			'Content-Type': 'application/json'
		}
	})
}

// token获取信息
export function getInfo() {
	return fetch({
		url: 'insurance/business/login/getInfo',
		method: 'post'
	})
}
